
<template>
  <div v-if="id==null">请选择审核题库好来此页面</div>
  <div v-else></div>
</template>
<script>
export default {
  watch: {
    "$route.query.id": {
      immediate: true, // 一开始的数据也要当做一种变化
      handler(val, old) {
        this.id = val;
        this.init();
      },
    },
  },
  data() {
    return {
      id: null,
    };
  },
  methods: {
    init() {
      if (this.id != null) {
        this.$http({
          url: this.$http.adornUrl("/tiku/paper/gettemplates/" + this.id),
          method: "get",
        }).then(({ data }) => {
          console.log(data);
        });
      }
    },
  },
};
</script>
